package com.leo.spring.strategy;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 类描述
 *
 * @author razor.liu
 * @version 1.0
 * @date 2021/11/5 10:17 下午
 */
@RestController
public class StrategyController {

    @Autowired
    private StrategyFactory strategyFactory;

    @GetMapping("/test")
    public String test(@RequestParam("name") String name) throws Exception {
        return strategyFactory.getStrategy(name).getName();
    }


}
